/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dao;

import bentity.beIngreso;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;

/**
 *
 * @author chokewanka
 */
public class daoIngreso {
    public int registrarIngreso() throws Exception{
        Connection conn = null;
        PreparedStatement ps = null;
        String sql = "INSERT INTO INGRESO (id_ingreso,fecha_ingreso,hora) VALUES (?,now(),current_timestamp)";
        conn = daoHelper.dameConexion();
        ps = conn.prepareStatement(sql);
        int idIngreso=(daoHelper.getNextId("INGRESO", "ID_INGRESO"));
        ps.setInt(1, idIngreso);
        ps.executeUpdate();
        ps.close();
        conn.close();
        return idIngreso;
    }
}
